package com.wl.dzt.config;

import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.repository.DefaultRateLimiterErrorHandler;
import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.repository.RateLimiterErrorHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author wl_code@163.com
 * @version 1.0
 * @date 2018/8/2/002
 * @description 限流配置
 */
@Component
public class RateLimitConfig {

    @Bean
    public RateLimiterErrorHandler rateLimiterErrorHandler(){
        return new DefaultRateLimiterErrorHandler(){
            @Override
            public void handleSaveError(String key, Exception e) {
                super.handleSaveError(key, e);
            }

            @Override
            public void handleFetchError(String key, Exception e) {
                super.handleFetchError(key, e);
            }

            @Override
            public void handleError(String msg, Exception e) {
                super.handleError(msg, e);
            }
        };

    }
}
